package com.gitee.llj.api.service.sys.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.gitee.llj.api.mapper.sys.SysUserGroupMapper;
import com.gitee.llj.api.service.sys.ISysUserGroupService;
import com.gitee.llj.entity.sys.SysUserGroup;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户组关联表 服务实现类
 * </p>
 *
 * @author llj
 * @since 2018-03-16
 */
@Service
public class SysUserGroupService extends ServiceImpl<SysUserGroupMapper, SysUserGroup> implements ISysUserGroupService {

    @Override
    public List<SysUserGroup> selectUserGroups(String userId) {
        if (StringUtils.isNotBlank(userId)){
            EntityWrapper<SysUserGroup> ew=new EntityWrapper<>();
            ew.eq("user_id",userId);
            return this.selectList(ew);
        }
        return null;
    }
}
